<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book python高级 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>用户管理 | python高级</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../day17/05.master_slave.html" />
    
    
    <link rel="prev" href="../day17/03.sql_index.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="7.4"
        data-chapter-title="用户管理"
        data-filepath="day17/04.user.md"
        data-basepath=".."
        data-revision="Wed Sep 26 2018 22:46:13 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Python高级
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="day11/00.readme.html">
            
                
                    <a href="../day11/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Python语法高级专题1
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="day11/01.GIL.html">
            
                
                    <a href="../day11/01.GIL.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        GIL问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="day11/02.copy.html">
            
                
                    <a href="../day11/02.copy.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        赋值-浅拷贝-深拷贝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="day11/03.import.html">
            
                
                    <a href="../day11/03.import.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        import导入模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="day11/04.review.html">
            
                
                    <a href="../day11/04.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="day12/00.readme.html">
            
                
                    <a href="../day12/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Python语法高级专题2
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="day12/01.mro.html">
            
                
                    <a href="../day12/01.mro.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        多继承和MRO顺序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="day12/02.property.html">
            
                
                    <a href="../day12/02.property.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        property属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="day12/03.magic.html">
            
                
                    <a href="../day12/03.magic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        魔法属性和方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="day12/04.with.html">
            
                
                    <a href="../day12/04.with.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        with管理上下文
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="day12/05.review.html">
            
                
                    <a href="../day12/05.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="day13/00.readme.html">
            
                
                    <a href="../day13/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Python语法之装饰器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="day13/01.closure.html">
            
                
                    <a href="../day13/01.closure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        闭包
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="day13/02.decorator.html">
            
                
                    <a href="../day13/02.decorator.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        装饰器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="day13/03.review.html">
            
                
                    <a href="../day13/03.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="day14/00.readme.html">
            
                
                    <a href="../day14/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        MySQL数据库基本操作
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="day14/01.数据库概述.html">
            
                
                    <a href="../day14/01.数据库概述.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        数据库概述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="day14/02.数据类型和约束.html">
            
                
                    <a href="../day14/02.数据类型和约束.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        数据完整性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="day14/03.Navicat.html">
            
                
                    <a href="../day14/03.Navicat.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        图形化客户端Navicat
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="day14/04.命令行客户端.html">
            
                
                    <a href="../day14/04.命令行客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        命令行客户端SQL的使用
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="day14/05.sql_con.html">
            
                
                    <a href="../day14/05.sql_con.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        登录和退出数据库
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="day14/07.sql_table_struct.html">
            
                
                    <a href="../day14/07.sql_table_struct.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        表结构的操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="day14/06.sql_database.html">
            
                
                    <a href="../day14/06.sql_database.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        数据库的操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.4" data-path="day14/08.表数据操作.html">
            
                
                    <a href="../day14/08.表数据操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.4.</b>
                        
                        表数据的操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="day14/09.review.html">
            
                
                    <a href="../day14/09.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        知识总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="day15/00.readme.html">
            
                
                    <a href="../day15/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        MYSQL数据库进阶操作
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="day15/01.练习.html">
            
                
                    <a href="../day15/01.练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        练习强化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="day15/02.where条件.html">
            
                
                    <a href="../day15/02.where条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="day15/03.排序查询.html">
            
                
                    <a href="../day15/03.排序查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="day15/04.分页查询.html">
            
                
                    <a href="../day15/04.分页查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        分页
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="day15/05.聚合函数.html">
            
                
                    <a href="../day15/05.聚合函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        聚合函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="day15/06.分组.html">
            
                
                    <a href="../day15/06.分组.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        分组
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="day15/07.连接.html">
            
                
                    <a href="../day15/07.连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        连接
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="day15/08.自连接.html">
            
                
                    <a href="../day15/08.自连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        自连接
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="day15/09.子查询.html">
            
                
                    <a href="../day15/09.子查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        子查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="day15/10.总结.html">
            
                
                    <a href="../day15/10.总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="day16/readme.html">
            
                
                    <a href="../day16/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        MYSQL数据库编程
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="day16/data.html">
            
                
                    <a href="../day16/data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        数据准备
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="day16/sql_code.html">
            
                
                    <a href="../day16/sql_code.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        SQL演练
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="day16/dbdesign.html">
            
                
                    <a href="../day16/dbdesign.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        数据库设计
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="day16/pymysql.html">
            
                
                    <a href="../day16/pymysql.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        数据库编程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="day16/zongjie.html">
            
                
                    <a href="../day16/zongjie.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="day17/00.readme.html">
            
                
                    <a href="../day17/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        MySQL数据库高级用法
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="day17/01.view.html">
            
                
                    <a href="../day17/01.view.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        视图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="day17/02.transaction.html">
            
                
                    <a href="../day17/02.transaction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        事务
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="day17/03.sql_index.html">
            
                
                    <a href="../day17/03.sql_index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        索引
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="7.4" data-path="day17/04.user.html">
            
                
                    <a href="../day17/04.user.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        用户管理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="day17/05.master_slave.html">
            
                
                    <a href="../day17/05.master_slave.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        主从配置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="day17/06.review.html">
            
                
                    <a href="../day17/06.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="day18/00.readme.html">
            
                
                    <a href="../day18/00.readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        miniweb框架
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="day18/01.框架是什么.html">
            
                
                    <a href="../day18/01.框架是什么.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        框架概念
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="day18/02.实现框架.html">
            
                
                    <a href="../day18/02.实现框架.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        实现一个简单的框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="day18/03.模板.html">
            
                
                    <a href="../day18/03.模板.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        模板替换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="day18/04.路由.html">
            
                
                    <a href="../day18/04.路由.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        路由概念
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="day18/05.显示股票数据.html">
            
                
                    <a href="../day18/05.显示股票数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        股票收藏夹
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.6" data-path="day18/05.review.html">
            
                
                    <a href="../day18/05.review.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.6.</b>
                        
                        复习
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >python高级</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="4-&#x8D26;&#x6237;&#x7BA1;&#x7406;">4. &#x8D26;&#x6237;&#x7BA1;&#x7406;</h1>
<h2 id="41-&#x5B66;&#x4E60;&#x76EE;&#x6807;">4.1 &#x5B66;&#x4E60;&#x76EE;&#x6807;</h2>
<ol>
<li>&#x80FD;&#x591F;&#x4F7F;&#x7528; grant &#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x5E76;&#x4E14;&#x6388;&#x6743;</li>
<li>&#x80FD;&#x591F;&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x7684;&#x5BC6;&#x7801;</li>
<li>&#x80FD;&#x591F;&#x4FEE;&#x6539;&#x4E00;&#x4E2A;&#x7528;&#x6237;&#x7684;&#x6743;&#x9650;</li>
</ol>
<hr>
<h2 id="42-mysql&#x8D26;&#x6237;&#x7BA1;&#x7406;">4.2 MySQL&#x8D26;&#x6237;&#x7BA1;&#x7406;</h2>
<ul>
<li><p>&#x5728;&#x6211;&#x4EEC;&#x4E4B;&#x524D;&#x767B;&#x5F55;MySQL&#x7684;&#x65F6;&#x5019;&#x6211;&#x4EEC;&#x90FD;&#x662F;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x7684;root&#x7528;&#x6237;&#xFF0C;root&#x7528;&#x6237;&#x5C5E;&#x4E8E;&#x6570;&#x636E;&#x5E93;&#x7CFB;&#x7EDF;&#x4E2D;&#x7684;&#x8D85;&#x7EA7;&#x7BA1;&#x7406;&#x5458;&#xFF0C;&#x6709;&#x6743;&#x9650;&#x5BF9;mysql&#x8FDB;&#x884C;&#x4EFB;&#x4F55;&#x60F3;&#x8981;&#x505A;&#x7684;&#x64CD;&#x4F5C;&#x3002;</p>
</li>
<li><p>&#x5982;&#x679C;&#x5728;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#x4E0B;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#x65F6;&#x4E5F;&#x662F;&#x5168;&#x90E8;&#x76F4;&#x63A5;&#x4F7F;&#x7528;root&#x8D26;&#x6237;&#x8FDE;&#x63A5;&#xFF0C;&#x8FD9;&#x5C31;&#x548C;&#x60AC;&#x5D16;&#x8FB9;&#x8DF3;&#x821E;&#x5DEE;&#x4E0D;&#x591A;&#x3002;&#x6240;&#x4EE5; &#x521B;&#x5EFA;&#x7279;&#x5B9A;&#x7684;&#x8D26;&#x6237;&#xFF0C;&#x6388;&#x4E88;&#x8FD9;&#x4E2A;&#x8D26;&#x6237;&#x7279;&#x5B9A;&#x7684;&#x64CD;&#x4F5C;&#x6743;&#x9650;&#xFF0C;&#x7136;&#x540E;&#x8FDE;&#x63A5;&#x8FDB;&#x884C;&#x64CD;&#x4F5C; &#x6BD4;&#x5982;&#x5E38;&#x89C4;&#x7684;crud &#x624D;&#x662F;&#x6B63;&#x9053;&#x3002;</p>
</li>
<li><p>MySQL&#x8D26;&#x6237;&#x4F53;&#x7CFB;&#xFF1A;&#x6839;&#x636E;&#x8D26;&#x6237;&#x6240;&#x5177;&#x6709;&#x7684;&#x6743;&#x9650;&#x7684;&#x4E0D;&#x540C;&#xFF0C;MySQL&#x7684;&#x8D26;&#x6237;&#x53EF;&#x4EE5;&#x5206;&#x4E3A;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;</p>
<ul>
<li>&#x670D;&#x52A1;&#x5B9E;&#x4F8B;&#x7EA7;&#x8D26;&#x53F7;&#xFF1A;&#xFF0C;&#x542F;&#x52A8;&#x4E86;&#x4E00;&#x4E2A;mysqld&#xFF0C;&#x5373;&#x4E3A;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x5B9E;&#x4F8B;&#xFF1B;&#x5982;&#x679C;&#x67D0;&#x7528;&#x6237;&#x5982;root,&#x62E5;&#x6709;&#x670D;&#x52A1;&#x5B9E;&#x4F8B;&#x7EA7;&#x5206;&#x914D;&#x7684;&#x6743;&#x9650;&#xFF0C;&#x90A3;&#x4E48;&#x8BE5;&#x8D26;&#x53F7;&#x5C31;&#x53EF;&#x4EE5;&#x5220;&#x9664;&#x6240;&#x6709;&#x7684;&#x6570;&#x636E;&#x5E93;&#x3001;&#x8FDE;&#x540C;&#x8FD9;&#x4E9B;&#x5E93;&#x4E2D;&#x7684;&#x8868;</li>
<li>&#x6570;&#x636E;&#x5E93;&#x7EA7;&#x522B;&#x8D26;&#x53F7;&#xFF1A;&#x5BF9;&#x7279;&#x5B9A;&#x6570;&#x636E;&#x5E93;&#x6267;&#x884C;&#x589E;&#x5220;&#x6539;&#x67E5;&#x7684;&#x6240;&#x6709;&#x64CD;&#x4F5C;</li>
<li>&#x6570;&#x636E;&#x8868;&#x7EA7;&#x522B;&#x8D26;&#x53F7;&#xFF1A;&#x5BF9;&#x7279;&#x5B9A;&#x8868;&#x6267;&#x884C;&#x589E;&#x5220;&#x6539;&#x67E5;&#x7B49;&#x6240;&#x6709;&#x64CD;&#x4F5C;</li>
<li>&#x5B57;&#x6BB5;&#x7EA7;&#x522B;&#x7684;&#x6743;&#x9650;&#xFF1A;&#x5BF9;&#x67D0;&#x4E9B;&#x8868;&#x7684;&#x7279;&#x5B9A;&#x5B57;&#x6BB5;&#x8FDB;&#x884C;&#x64CD;&#x4F5C;</li>
<li>&#x5B58;&#x50A8;&#x7A0B;&#x5E8F;&#x7EA7;&#x522B;&#x7684;&#x8D26;&#x53F7;&#xFF1A;&#x5BF9;&#x5B58;&#x50A8;&#x7A0B;&#x5E8F;&#x8FDB;&#x884C;&#x589E;&#x5220;&#x6539;&#x67E5;&#x7684;&#x64CD;&#x4F5C;</li>
</ul>
</li>
</ul>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x8FDB;&#x884C;&#x8D26;&#x6237;&#x64CD;&#x4F5C;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x4F7F;&#x7528;root&#x8D26;&#x6237;&#x767B;&#x5F55;&#xFF0C;&#x8FD9;&#x4E2A;&#x8D26;&#x6237;&#x62E5;&#x6709;&#x6700;&#x9AD8;&#x7684;&#x5B9E;&#x4F8B;&#x7EA7;&#x6743;&#x9650;&#x3002;&#x8D26;&#x6237;&#x7684;&#x64CD;&#x4F5C;&#x4E3B;&#x8981;&#x5305;&#x62EC;&#x521B;&#x5EFA;&#x8D26;&#x6237;&#x3001;&#x5220;&#x9664;&#x8D26;&#x6237;&#x3001;&#x4FEE;&#x6539;&#x5BC6;&#x7801;&#x3001;&#x6388;&#x6743;&#x6743;&#x9650;&#x7B49;&#x3002;</p>
</blockquote>
<h2 id="43-&#x6388;&#x4E88;&#x6743;&#x9650;">4.3 &#x6388;&#x4E88;&#x6743;&#x9650;</h2>
<p>&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5B9E;&#x4F8B;&#x7EA7;&#x8D26;&#x6237;&#x767B;&#x5F55;&#x540E;&#x64CD;&#x4F5C;&#xFF0C;&#x4EE5;root&#x4E3A;&#x4F8B;</p>
<p>&#x4E3B;&#x8981;&#x64CD;&#x4F5C;&#x5305;&#x62EC;&#xFF1A;</p>
<ul>
<li>&#x67E5;&#x770B;&#x6240;&#x6709;&#x7528;&#x6237;</li>
<li>&#x4FEE;&#x6539;&#x5BC6;&#x7801;</li>
<li>&#x5220;&#x9664;&#x7528;&#x6237;</li>
</ul>
<h3 id="431-&#x67E5;&#x770B;&#x6240;&#x6709;&#x7528;&#x6237;">4.3.1 &#x67E5;&#x770B;&#x6240;&#x6709;&#x7528;&#x6237;</h3>
<ul>
<li>&#x6240;&#x6709;&#x7528;&#x6237;&#x53CA;&#x6743;&#x9650;&#x4FE1;&#x606F;&#x5B58;&#x50A8;&#x5728;mysql&#x6570;&#x636E;&#x5E93;&#x7684;user&#x8868;&#x4E2D;</li>
<li>&#x67E5;&#x770B;user&#x8868;&#x7684;&#x7ED3;&#x6784;</li>
</ul>
<pre><code class="lang-sql">desc user;
</code></pre>
<ul>
<li>&#x4E3B;&#x8981;&#x5B57;&#x6BB5;&#x8BF4;&#x660E;&#xFF1A;<ul>
<li>Host&#x8868;&#x793A;&#x5141;&#x8BB8;&#x8BBF;&#x95EE;&#x7684;&#x4E3B;&#x673A;</li>
<li>User&#x8868;&#x793A;&#x7528;&#x6237;&#x540D;</li>
<li>authentication_string&#x8868;&#x793A;&#x5BC6;&#x7801;&#xFF0C;&#x4E3A;&#x52A0;&#x5BC6;&#x540E;&#x7684;&#x503C;</li>
</ul>
</li>
</ul>
<p>&#x67E5;&#x770B;&#x6240;&#x6709;&#x7528;&#x6237;</p>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">select</span> host,<span class="hljs-keyword">user</span>,authentication_string <span class="hljs-keyword">from</span> <span class="hljs-keyword">user</span>;</span>
</code></pre>
<p>&#x7ED3;&#x679C;</p>
<pre><code class="lang-sql">mysql&gt; select host,user,authentication_string from user;
+-----------+------------------+-------------------------------------------+
| host      | user             | authentication_string                     |
+-----------+------------------+-------------------------------------------+
| localhost | root             | *E74858DB86EBA20BC33D0AECAE8A8108C56B17FA |
| localhost | mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | debian-sys-maint | *EFED9C764966EDB33BB7318E1CBD122C0DFE4827 |
+-----------+------------------+-------------------------------------------+
3 rows in set (0.00 sec)
</code></pre>
<h3 id="432-&#x521B;&#x5EFA;&#x8D26;&#x6237;&#x3001;&#x6388;&#x6743;">4.3.2 &#x521B;&#x5EFA;&#x8D26;&#x6237;&#x3001;&#x6388;&#x6743;</h3>
<ul>
<li>&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5B9E;&#x4F8B;&#x7EA7;&#x8D26;&#x6237;&#x767B;&#x5F55;&#x540E;&#x64CD;&#x4F5C;&#xFF0C;&#x4EE5;root&#x4E3A;&#x4F8B;</li>
<li>&#x5E38;&#x7528;&#x6743;&#x9650;&#x4E3B;&#x8981;&#x5305;&#x62EC;&#xFF1A;create&#x3001;alter&#x3001;drop&#x3001;insert&#x3001;update&#x3001;delete&#x3001;select</li>
<li>&#x5982;&#x679C;&#x5206;&#x914D;&#x6240;&#x6709;&#x6743;&#x9650;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;all privileges</li>
</ul>
<h4 id="4321-&#x521B;&#x5EFA;&#x8D26;&#x6237;&#x6388;&#x6743;">4.3.2.1 &#x521B;&#x5EFA;&#x8D26;&#x6237;&amp;&#x6388;&#x6743;</h4>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">grant</span> &#x6743;&#x9650;&#x5217;&#x8868; <span class="hljs-keyword">on</span> &#x6570;&#x636E;&#x5E93; <span class="hljs-keyword">to</span> <span class="hljs-string">&apos;&#x7528;&#x6237;&#x540D;&apos;</span>@<span class="hljs-string">&apos;&#x8BBF;&#x95EE;&#x4E3B;&#x673A;&apos;</span> <span class="hljs-keyword">identified</span> <span class="hljs-keyword">by</span> <span class="hljs-string">&apos;&#x5BC6;&#x7801;&apos;</span>;</span>
</code></pre>
<h4 id="4322-&#x793A;&#x4F8B;1">4.3.2.2 &#x793A;&#x4F8B;1</h4>
<p>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;<code>laowang</code>&#x7684;&#x8D26;&#x53F7;&#xFF0C;&#x5BC6;&#x7801;&#x4E3A;<code>123456</code>&#xFF0C;&#x53EA;&#x80FD;&#x901A;&#x8FC7;&#x672C;&#x5730;&#x8BBF;&#x95EE;, &#x5E76;&#x4E14;&#x53EA;&#x80FD;&#x5BF9;<code>jing_dong</code>&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x8868;&#x8FDB;&#x884C;<code>&#x8BFB;</code>&#x64CD;&#x4F5C;</p>
<h5 id="step1&#xFF1A;&#x4F7F;&#x7528;root&#x767B;&#x5F55;">step1&#xFF1A;&#x4F7F;&#x7528;root&#x767B;&#x5F55;</h5>
<pre><code class="lang-sql">mysql -uroot -p
&#x56DE;&#x8F66;&#x540E;&#x5199;&#x5BC6;&#x7801;&#xFF0C;&#x7136;&#x540E;&#x56DE;&#x8F66;
</code></pre>
<h5 id="step2&#xFF1A;&#x521B;&#x5EFA;&#x8D26;&#x6237;&#x5E76;&#x6388;&#x4E88;&#x6240;&#x6709;&#x6743;&#x9650;">step2&#xFF1A;&#x521B;&#x5EFA;&#x8D26;&#x6237;&#x5E76;&#x6388;&#x4E88;&#x6240;&#x6709;&#x6743;&#x9650;</h5>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">grant</span> <span class="hljs-keyword">select</span> <span class="hljs-keyword">on</span> jing_dong.* <span class="hljs-keyword">to</span> <span class="hljs-string">&apos;laowang&apos;</span>@<span class="hljs-string">&apos;localhost&apos;</span> <span class="hljs-keyword">identified</span> <span class="hljs-keyword">by</span> <span class="hljs-string">&apos;123456&apos;</span>;</span>
</code></pre>
<p>&#x8BF4;&#x660E;</p>
<ul>
<li>&#x53EF;&#x4EE5;&#x64CD;&#x4F5C;python&#x6570;&#x636E;&#x5E93;&#x7684;&#x6240;&#x6709;&#x8868;&#xFF0C;&#x65B9;&#x5F0F;&#x4E3A;:<code>jing_dong.*</code></li>
<li>&#x8BBF;&#x95EE;&#x4E3B;&#x673A;&#x901A;&#x5E38;&#x4F7F;&#x7528; &#x767E;&#x5206;&#x53F7;% &#x8868;&#x793A;&#x6B64;&#x8D26;&#x6237;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4EFB;&#x4F55;ip&#x7684;&#x4E3B;&#x673A;&#x767B;&#x5F55;&#x8BBF;&#x95EE;&#x6B64;&#x6570;&#x636E;&#x5E93;</li>
<li>&#x8BBF;&#x95EE;&#x4E3B;&#x673A;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x6210; localhost&#x6216;&#x5177;&#x4F53;&#x7684;ip&#xFF0C;&#x8868;&#x793A;&#x53EA;&#x5141;&#x8BB8;&#x672C;&#x673A;&#x6216;&#x7279;&#x5B9A;&#x4E3B;&#x673A;&#x8BBF;&#x95EE;</li>
</ul>
<ul>
<li>&#x67E5;&#x770B;&#x7528;&#x6237;&#x6709;&#x54EA;&#x4E9B;&#x6743;&#x9650;</li>
</ul>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">show</span> <span class="hljs-keyword">grants</span> <span class="hljs-keyword">for</span> laowang@localhost;</span>
</code></pre>
<h5 id="step3&#xFF1A;&#x9000;&#x51FA;root&#x7684;&#x767B;&#x5F55;">step3&#xFF1A;&#x9000;&#x51FA;root&#x7684;&#x767B;&#x5F55;</h5>
<pre><code class="lang-sql">quit
</code></pre>
<h5 id="step4&#xFF1A;&#x4F7F;&#x7528;laowang&#x8D26;&#x6237;&#x767B;&#x5F55;">step4&#xFF1A;&#x4F7F;&#x7528;laowang&#x8D26;&#x6237;&#x767B;&#x5F55;</h5>
<pre><code class="lang-sql">mysql -ulaowang -p
&#x56DE;&#x8F66;&#x540E;&#x5199;&#x5BC6;&#x7801;&#xFF0C;&#x7136;&#x540E;&#x56DE;&#x8F66;
</code></pre>
<ul>
<li>&#x767B;&#x5F55;&#x540E;&#x6548;&#x679C;&#x5982;&#x4E0B;&#x56FE;</li>
</ul>
<p><img src="../assets/day17/01.png" alt="">
<img src="../assets/day17/02.png" alt=""></p>
<h4 id="4323-&#x793A;&#x4F8B;2">4.3.2.3 &#x793A;&#x4F8B;2</h4>
<p>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;<code>laoli</code>&#x7684;&#x8D26;&#x53F7;&#xFF0C;&#x5BC6;&#x7801;&#x4E3A;<code>12345678</code>&#xFF0C;&#x53EF;&#x4EE5;&#x4EFB;&#x610F;&#x7535;&#x8111;&#x8FDB;&#x884C;&#x94FE;&#x63A5;&#x8BBF;&#x95EE;, &#x5E76;&#x4E14;&#x5BF9;<code>jing_dong</code>&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x8868;&#x62E5;&#x6709;&#x6240;&#x6709;&#x6743;&#x9650;</p>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">grant</span> all <span class="hljs-keyword">privileges</span> <span class="hljs-keyword">on</span> jing_dong.* <span class="hljs-keyword">to</span> <span class="hljs-string">&quot;laoli&quot;</span>@<span class="hljs-string">&quot;%&quot;</span> <span class="hljs-keyword">identified</span> <span class="hljs-keyword">by</span> <span class="hljs-string">&quot;12345678&quot;</span>
</span></code></pre>
<p><img src="../assets/day17/03.png" alt="">
<img src="../assets/day17/04.png" alt="">
<img src="../assets/day17/05.png" alt=""></p>
<h2 id="44-&#x8D26;&#x6237;&#x64CD;&#x4F5C;">4.4 &#x8D26;&#x6237;&#x64CD;&#x4F5C;</h2>
<h3 id="441-&#x4FEE;&#x6539;&#x6743;&#x9650;">4.4.1 &#x4FEE;&#x6539;&#x6743;&#x9650;</h3>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">grant</span> &#x6743;&#x9650;&#x540D;&#x79F0; <span class="hljs-keyword">on</span> &#x6570;&#x636E;&#x5E93; <span class="hljs-keyword">to</span> &#x8D26;&#x6237;@&#x4E3B;&#x673A; <span class="hljs-keyword">with</span> <span class="hljs-keyword">grant</span> <span class="hljs-keyword">option</span>;</span>
</code></pre>
<p><img src="../assets/day17/06.png" alt=""></p>
<p><img src="../assets/day17/07.png" alt="">
<img src="../assets/day17/08.png" alt=""></p>
<h3 id="442-&#x4FEE;&#x6539;&#x5BC6;&#x7801;">4.4.2 &#x4FEE;&#x6539;&#x5BC6;&#x7801;</h3>
<p>&#x4F7F;&#x7528;root&#x767B;&#x5F55;&#xFF0C;&#x4FEE;&#x6539;mysql&#x6570;&#x636E;&#x5E93;&#x7684;user&#x8868;</p>
<ul>
<li><p>&#x4F7F;&#x7528;password()&#x51FD;&#x6570;&#x8FDB;&#x884C;&#x5BC6;&#x7801;&#x52A0;&#x5BC6;</p>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">update</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">set</span> authentication_string=<span class="hljs-keyword">password</span>(<span class="hljs-string">&apos;&#x65B0;&#x5BC6;&#x7801;&apos;</span>) <span class="hljs-keyword">where</span> <span class="hljs-keyword">user</span>=<span class="hljs-string">&apos;&#x7528;&#x6237;&#x540D;&apos;</span>;</span>
&#x4F8B;&#xFF1A;
<span class="hljs-operator"><span class="hljs-keyword">update</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">set</span> authentication_string=<span class="hljs-keyword">password</span>(<span class="hljs-string">&apos;123&apos;</span>) <span class="hljs-keyword">where</span> <span class="hljs-keyword">user</span>=<span class="hljs-string">&apos;laowang&apos;</span>;</span>
</code></pre>
</li>
<li><p>&#x6CE8;&#x610F;&#x4FEE;&#x6539;&#x5B8C;&#x6210;&#x540E;&#x9700;&#x8981;&#x5237;&#x65B0;&#x6743;&#x9650;</p>
<pre><code class="lang-sql">&#x5237;&#x65B0;&#x6743;&#x9650;&#xFF1A;<span class="hljs-operator"><span class="hljs-keyword">flush</span> <span class="hljs-keyword">privileges</span>
</span></code></pre>
</li>
</ul>
<h3 id="443-&#x8FDC;&#x7A0B;&#x767B;&#x5F55;&#xFF08;&#x5371;&#x9669;&#x614E;&#x7528;&#xFF09;">4.4.3 &#x8FDC;&#x7A0B;&#x767B;&#x5F55;&#xFF08;&#x5371;&#x9669;-&#x614E;&#x7528;&#xFF09;</h3>
<p>&#x5982;&#x679C;&#x5411;&#x5728;&#x4E00;&#x4E2A;Ubuntu&#x4E2D;&#x4F7F;&#x7528;mysql&#x547D;&#x4EE4;&#x8FDC;&#x7A0B;&#x8FDE;&#x63A5;&#x53E6;&#x5916;&#x4E00;&#x53F0;mysql&#x670D;&#x52A1;&#x5668;&#x7684;&#x8BDD;&#xFF0C;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x65B9;&#x5F0F;&#x5373;&#x53EF;&#x5B8C;&#x6210;&#xFF0C;&#x4F46;&#x662F;&#x6B64;&#x65B9;&#x6CD5;&#x4EC5;&#x4EC5;&#x4E86;&#x89E3;&#x5C31;&#x597D;&#x4E86;&#xFF0C;&#x4E0D;&#x8981;&#x5728;&#x5B9E;&#x9645;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#x4E2D;&#x4F7F;&#x7528;</p>
<p>&#x4FEE;&#x6539; /etc/mysql/mysql.conf.d/mysqld.cnf &#x6587;&#x4EF6;</p>
<pre><code>vim /etc/mysql/mysql.conf.d/mysqld.cnf
</code></pre><p><img src="../assets/day17/09.png" alt=""></p>
<p>&#x7136;&#x540E;&#x91CD;&#x542F;msyql</p>
<pre><code class="lang-sql">service mysql restart
</code></pre>
<p>&#x5728;&#x53E6;&#x5916;&#x4E00;&#x53F0;Ubuntu&#x4E2D;&#x8FDB;&#x884C;&#x8FDE;&#x63A5;&#x6D4B;&#x8BD5;</p>
<p><img src="../assets/day17/10.png" alt=""></p>
<p>&#x5982;&#x679C;&#x4F9D;&#x7136;&#x8FDE;&#x4E0D;&#x4E0A;&#xFF0C;&#x53EF;&#x80FD;&#x539F;&#x56E0;&#xFF1A;</p>
<p>1) &#x7F51;&#x7EDC;&#x4E0D;&#x901A;</p>
<blockquote>
<p>&#x901A;&#x8FC7; ping xxx.xxx.xx.xxx&#x53EF;&#x4EE5;&#x53D1;&#x73B0;&#x7F51;&#x7EDC;&#x662F;&#x5426;&#x6B63;&#x5E38;</p>
</blockquote>
<p>2)&#x67E5;&#x770B;&#x6570;&#x636E;&#x5E93;&#x662F;&#x5426;&#x914D;&#x7F6E;&#x4E86;bind_address&#x53C2;&#x6570;</p>
<blockquote>
<p>&#x672C;&#x5730;&#x767B;&#x5F55;&#x6570;&#x636E;&#x5E93;&#x67E5;&#x770B;my.cnf&#x6587;&#x4EF6;&#x548C;&#x6570;&#x636E;&#x5E93;&#x5F53;&#x524D;&#x53C2;&#x6570;show variables like &apos;bind_address&apos;;</p>
<p>&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E86;bind_address=127.0.0.1 &#x90A3;&#x4E48;&#x53EA;&#x80FD;&#x672C;&#x5730;&#x767B;&#x5F55;</p>
</blockquote>
<p>3)&#x67E5;&#x770B;&#x6570;&#x636E;&#x5E93;&#x662F;&#x5426;&#x8BBE;&#x7F6E;&#x4E86;skip_networking&#x53C2;&#x6570;</p>
<blockquote>
<p>&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E86;&#x8BE5;&#x53C2;&#x6570;&#xFF0C;&#x90A3;&#x4E48;&#x53EA;&#x80FD;&#x672C;&#x5730;&#x767B;&#x5F55;mysql&#x6570;&#x636E;&#x5E93;</p>
</blockquote>
<p>4)&#x7AEF;&#x53E3;&#x6307;&#x5B9A;&#x662F;&#x5426;&#x6B63;&#x786E;</p>
<h3 id="444-&#x5220;&#x9664;&#x8D26;&#x6237;">4.4.4 &#x5220;&#x9664;&#x8D26;&#x6237;</h3>
<ul>
<li>&#x8BED;&#x6CD5;1&#xFF1A;&#x4F7F;&#x7528;root&#x767B;&#x5F55;</li>
</ul>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">drop</span> <span class="hljs-keyword">user</span> <span class="hljs-string">&apos;&#x7528;&#x6237;&#x540D;&apos;</span>@<span class="hljs-string">&apos;&#x4E3B;&#x673A;&apos;</span>;</span>
&#x4F8B;&#xFF1A;
<span class="hljs-operator"><span class="hljs-keyword">drop</span> <span class="hljs-keyword">user</span> <span class="hljs-string">&apos;laowang&apos;</span>@<span class="hljs-string">&apos;%&apos;</span>;</span>
</code></pre>
<ul>
<li>&#x8BED;&#x6CD5;2&#xFF1A;&#x4F7F;&#x7528;root&#x767B;&#x5F55;&#xFF0C;&#x5220;&#x9664;mysql&#x6570;&#x636E;&#x5E93;&#x7684;user&#x8868;&#x4E2D;&#x6570;&#x636E;</li>
</ul>
<pre><code class="lang-sql"><span class="hljs-operator"><span class="hljs-keyword">delete</span> <span class="hljs-keyword">from</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">where</span> <span class="hljs-keyword">user</span>=<span class="hljs-string">&apos;&#x7528;&#x6237;&#x540D;&apos;</span>;</span>
&#x4F8B;&#xFF1A;
<span class="hljs-operator"><span class="hljs-keyword">delete</span> <span class="hljs-keyword">from</span> <span class="hljs-keyword">user</span> <span class="hljs-keyword">where</span> <span class="hljs-keyword">user</span>=<span class="hljs-string">&apos;laowang&apos;</span>;</span>

<span class="hljs-comment">-- &#x64CD;&#x4F5C;&#x7ED3;&#x675F;&#x4E4B;&#x540E;&#x9700;&#x8981;&#x5237;&#x65B0;&#x6743;&#x9650;</span>
<span class="hljs-operator"><span class="hljs-keyword">flush</span> <span class="hljs-keyword">privileges</span>
</span></code></pre>
<ul>
<li>&#x63A8;&#x8350;&#x4F7F;&#x7528;&#x8BED;&#x6CD5;1&#x5220;&#x9664;&#x7528;&#x6237;, &#x5982;&#x679C;&#x4F7F;&#x7528;&#x8BED;&#x6CD5;1&#x5220;&#x9664;&#x5931;&#x8D25;&#xFF0C;&#x91C7;&#x7528;&#x8BED;&#x6CD5;2&#x65B9;&#x5F0F;</li>
</ul>
<blockquote>
<p>&#x5FD8;&#x8BB0; root &#x8D26;&#x6237;&#x5BC6;&#x7801;&#x600E;&#x4E48;&#x529E; !!</p>
</blockquote>
<ul>
<li>&#x4E00;&#x822C;&#x4E5F;&#x8F6E;&#x4E0D;&#x5230;&#x6211;&#x4EEC;&#x6765;&#x7BA1;&#x7406; root &#x8D26;&#x6237;,&#x6240;&#x4EE5;&#x522B;&#x778E;&#x5356;&#x767D;&#x7C89;&#x7684;&#x5FC3;&#x4E86;</li>
<li>&#x4E07;&#x4E00;&#x5462;? &#x5230;&#x65F6;&#x5019;&#x518D;&#x6765;<a href="http://blog.csdn.net/lxpbs8851/article/details/10895085" target="_blank">http://blog.csdn.net/lxpbs8851/article/details/10895085</a></li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../day17/03.sql_index.html" class="navigation navigation-prev " aria-label="Previous page: 索引"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../day17/05.master_slave.html" class="navigation navigation-next " aria-label="Next page: 主从配置"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book python高级 -->
</html>
